package cn.edu.dlut.port.isp.bean.teach.simulation;
import cn.edu.dlut.port.optiplan.elem.Tide;
import java.util.NoSuchElementException;

/**
 *
 * @author tangguolei
 */
public class TideBean {

    public static int REGULARSEMIDIURNALTIDE = 1;
    public static int IRREGULARSEMIDIURNALTIDE = 2;
    public static int REGULARDIURALTIDE = 3;
    public static int IRREGULARDIURALTIDE = 4;
    public static String REGULARSEMIDIURNALTIDES = "正规半日潮";
    public static String IRREGULARSEMIDIURNALTIDES = "不正规半日潮";
    public static String REGULARDIURALTIDES = "正规全日潮";
    public static String IRREGULARDIURALTIDES = "不正规全日潮";
    private double tideRange;
    private double extLWL;
    private double desLWL;
    private double extHWL;
    private double desHWL;
    private String type;
    private int typeInt;
    private double averageWL;

    public TideBean(int tideType, double tideRange, double averageWL, double desHWL, double desLWL, double extHWL, double extLWL) {
        this.tideRange = tideRange;
        this.typeInt = tideType;
        this.type = getType(typeInt);
        this.averageWL = averageWL;
        this.desHWL = desHWL;
        this.desLWL = desLWL;
        this.extHWL = extHWL;
        this.extLWL = extLWL;
    }

    public static String getType(int type) {
        switch (type) {
            case 1:
                return REGULARSEMIDIURNALTIDES;
            case 2:
                return IRREGULARSEMIDIURNALTIDES;
            case 3:
                return REGULARDIURALTIDES;
            case 4:
                return IRREGULARDIURALTIDES;
            default:
                throw (new NoSuchElementException());
        }
    }

    public double getTideRange() {
        return tideRange;
    }

    public void setTideRange(double tideRange) {
        this.tideRange = tideRange;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getTypeInt() {
        return typeInt;
    }

    public void setTypeInt(int typeInt) {
        this.typeInt = typeInt;
    }

    public double getExtLWL() {
        return extLWL;
    }

    public void setExtLWL(double extLWL) {
        this.extLWL = extLWL;
    }

    public double getDesLWL() {
        return desLWL;
    }

    public void setDesLWL(double desLWL) {
        this.desLWL = desLWL;
    }

    public double getExtHWL() {
        return extHWL;
    }

    public void setExtHWL(double extHWL) {
        this.extHWL = extHWL;
    }

    public double getDesHWL() {
        return desHWL;
    }

    public void setDesHWL(double desHWL) {
        this.desHWL = desHWL;
    }

    public double getAverageWL() {
        return averageWL;
    }

    public Tide toTide() {
        return new Tide(typeInt, tideRange, averageWL);
    }
}
